package com.cin.cma.common.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;


@Getter
public enum HallTypeEnum {
    UNKNOWN("UNKNOWN", "未知"),
    NORMAL("NORMAL", "普通厅"),
    DOLBY("DOLBY", "杜比厅"),
    GIANT("GIANT", "巨幕厅"),
    IMAX("IMAX", "IMAX厅"),
    VIP("VIP", "贵宾厅"),
    MEETING("MEETING", "会议厅"),
    THIRD_DIMENSION("THIRD_DIMENSION", "3D厅"),
    THIRD_DIMENSION_IMAX("THIRD_DIMENSION_IMAX", "3D+IMAX厅"),
    THIRD_DIMENSION_GIANT("THIRD_DIMENSION_GIANT", "3D+巨幕厅"),
    ;

    private String code;
    private String name;

    HallTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 影厅类型转换
     *
     * @param hallType
     * @return
     */
    public static HallTypeEnum buildHallType(String hallType) {
        if (StrUtil.isBlank(hallType)) {
            return HallTypeEnum.UNKNOWN;
        }

        switch (hallType) {
            // 普通厅
            case "N":
                return HallTypeEnum.NORMAL;
            // IMAX
            case "I":
                return HallTypeEnum.IMAX;
            // 贵宾厅
            case "Y":
            case "V":
                return HallTypeEnum.VIP;
            // 会议厅
            case "M":
                return HallTypeEnum.MEETING;
            // 巨幕厅
            case "H":
                return HallTypeEnum.GIANT;
            // 杜比厅
            case "D":
                return HallTypeEnum.DOLBY;
            // 未知
            default:
                return HallTypeEnum.UNKNOWN;
        }
    }
}
